#!/bin/sh

# BBEdit / TextWrangler XML Tidy Script
# http://stackoverflow.com/questions/3018209/

# 1. Place into ~/Library/Application Support/BBEdit/Text Filters/
# 2. Quit and restart BBEdit
# 3. Select the text to format before running the script from the Script/Text menu

# xmllint is built into Mac OS X

xmllint --c14n - | XMLLINT_INDENT=$'\t' xmllint --encode UTF-8 --format -
